Copyright: Copyright ©


CONTENTS

Properties

Events

Getting Started


Properties

The following are properties that are important to the Videx Custom Control.

BackColor

BorderStyle

vCommPort

vFormatDate

vFormatTime

vID

vLoadProgram

vProgFileName

vShowErrors

vShowStatus

vStart

vTimeOut


BackColor

The BackColor property sets the background color for the custom control.  To select a color, double-click on the color value to the right of the property name.  A color selector box will appear.

To make the control blend-in with whatever is behind it, set BackColor to match the color of the form, frame or picture box that is is on.

Set the BorderStyle to 0-None to hide the edges.


BorderStyle

The BorderStyle sets the outline border of the control.  Choices are:

0-None

1-Thin

2-Thick

3-Double

To make the control blend-in with the control or the form behind it, set BorderStyle to 0-None and set the BackColor to match whatever is behind it.


vCommPort

vCommPort sets the comm port for the control.  The default is 0-COM1.  A comerror event error will occur if you set and run two instances of the same control on the same comm port.

If you have multiple instances of the control, you must set each instance to its own comm port or wait for one instance to finish before setting vStart to run the second.

NOTE: the comm port setting is zero-based. 0=1, 1=2, etc.


vError Event
ComError Event

The ComError event is fired when a communications error happens.  All communications to the Videx readers are shut-down when the ComError event is fired.  The ComEnd event will always follow the ComError event.

The Videx control will automatically display an error messagebox just prior to sending the ComError event unless you set the vShowErrors property to False.

The standard communication errors are returned as BASIC standard error codes:

24	Device time-out

25	Device fault

57	Device I/O error

68	Device Unavailable

69	Buffer overflow

In addition to the standard communications errors, the Videx control has added a few custom error numbers to handle errors specific to the Videx control or those not specifically assigned by BASIC:

255	Videx reader time-out

254	Comm port already opened

252	Unable to allocate memory queues

251	Unknown comm error

250 	Invalid wand ID

249	Too many clocks or timers

248	Program file not found or invalid


vShowErrors

The vShowErrors property enables or disables the showing of error messages by the control.

The Videx control will automatically show an error message box just prior to sending a ComError event unless the vShowErrors property is set to 0.


vFormatDate

The vFormatDate property sets the format of the date returned from the Videx readers in the ComInput event.  Formats are:

0-mm-dd-yyyy

1-mm-dd-yy

2-dd-mm-yyyy

3-dd-mm-yy

4-yyyymmdd

5-yymmdd

6-January 1, 1995

7-Jan 1, 1995

See also vFormatTime.


vFormatTime

The vFormatTime property sets the format of the time returned from the Videx readers in the ComInput event.  Formats are:

0-hh:mm

1-hh:mm am

2-hh:mm:ss

3-hh:mm:ss am

4-hhmm

5-hhmmss

see also vFormatDate


ComInput Event

The ComInput event is the workhorse for the control.  When the ComInput event is fired, it presents the programmer with a single formatted record from the Videx reader.  Data is passed in four variables:

vType:

0 - indicates that vDate and vTime contain the date and time the reader was last downloaded.

1 - indicates that the record is a bar code data record.

vRec

A string variable that contains the actual bar code data.  Valid only if vType = 1.

vTime

A string variable that contains the time the bar code was read if vType = 1 or the time the reader was last downloaded if vType = 0.  The format for the time is set with the vFormatTime property.

vDate

A string variable that contains the date the bar code was read if vType = 1 or the date the reader was last downloaded if vType = 0.  The format for the date is set with the vFormatDate property.

IMPORTANT!

Never set a delay in the ComInput event routine.  The Videx readers will time-out after approximately 10 seconds.  You will cause a time-out ComError event to occur if you delay here very long.  This is especially true if you are getting data from more that one comm port.

Also note that the control cannot receive any messages if you grab a window frame or title-bar with your mouse and hold it down.  This can also cause a time-out error.


EVENTS

The following are the events supported by the Videx custom control:

Click

ComEnd

ComError

ComInput


vID

The vID property sets a unique reader identification number.  vID works differently depending on whether you are downloading data from the reader or initializing the reader.  It is the programmers job to keep track of the ID numbers and supply them when communicating with the readers.

Initializing the reader:

vID is a unique ID number that will be assigned to the reader during initialization.  When the reader has been reset to factory defaults (see Videx manual), it can be unlocked by using 0 as the ID number.  If the reader has not been reset, it can only be unlocked using the number that it was initialized with.

Downloading data:
vID is used to unlock the Videx reader with the same number.  All other readers will ignore any attempt to open them unless vID is set to their unique ID number.

IMPORTANT!

Do not set more that one reader with the same vID number!


vLoadProgram

vLoadProgram property enables or disables the downloading of the configuration program to the Videx readers.

When initializing, always set vLoadProgram to True or it will not function properly.  When downloading data from the readers, vLoadProgram can be set to False.


vShowStatus

vShowStatus property enables or disables the display of status text above the percentage bar.  It does not affect the visibility status of the percentage bar itself.


vTimeOut

The vTimeOut property sets a limit on the time allowed to unlock a Videx reader.  When a reader is in a sleep state, it can take anywhere between 3 to 65 seconds to unlock the reader for communications.

Hint: you can speed the unlock process by pressing the button on the side of the reader once while the control is prompting it to unlock.

vTimeOut only effects the initial time it takes to unlock the reader.  Usually after one reader in a group has been unlocked, the others will come online immediately when prompted.


Click
Click Event

The Click event works the same as any other control's click event.  when the area of the control is clicked by the mouse, the Click event is fired.


ComEnd Event

The ComEnd event signals the end of communications with a single Videx reader.

When the ComEnd event has fired, you have the opportunity to change vID to the next unique ID number and restart communications with the vStart property.

Example:

Videx1_ComEnd()

  Videx1.vID = GetNextID()  'Assign the next ID number. (Your routine)

  If Videx1.vID > 0 Then    'Flag to check if done or not.

    Videx1.vStart = 2       'Restart comm. 2=Download, 1=Initialize

  End If

End Sub


vStart

vStart is a hidden runtime only property.  Meaning that it is not accessible from the properties list.  Its purpose is to initiate or cancel communications with the Videx readers.

vStart can be set to any of three values:

0 - Idle or cancel communications.

1 - Initialize a Videx reader.

2 - Download data from a Videx reader.

Example initialization:

Videx1.vID = 1      'Set reader ID to 1

Videx1.vStart = 1   'Start initialize process

Example download:

Videx1.vID = 1      'Set reader ID to 1

Videx1.vStart = 2   'Start download process

Example cancel:

Videx1.vStart = 0   'Cancel communications

Note: use vStart in the ComEnd event routine to restart communications with the next reader in the list.


Device Unavailable

This usually means that you have selected an invalid Comm port.


GETTING STARTED

The Videx custom control makes it easy to write programs that utilize the Videx Timewand1 or Durawand data collection readers.  It only supports these two readers.  Future versions of the control or separate controls may support the Videx TouchProbe, Timewand2, and others.

The following Quick-start tutorial demonstrates the ease of creating a simple data collection application.  This program is written in more detail with "TestVBX.MAK" included on the release diskette.

1. Start with a new form.

2. Place a Videx control on the form.  Be sure to drag the control high enough for the text above the percentage bar to show.

3. Place three command buttons on the form with captions: "Download", "Initialize", and  "Cancel.".

4. In the "Download" command button routine type:   Videx1.vStart = 2

5. In the "Initialize" command button routine type:    Videx1.vStart = 1

6. In the "Cancel" command button routine type:   Videx1.vStart = 0

7. Your done!  Run the program, Reset a reader and select the "Initialize" command button.

After you have Initialized a reader you can scan bar codes and select the "Download" command button to retrieve the data from the reader.  To quickly see the data that you have retrieved from the reader place "Debug.Print" statements in the ComInput event and the data will be displayed in the debug window.


Too many clocks or timers

Windows only allows 32 timers.  If you were to run more than 31 instances of the clock program you will get this error.


Invalid wand ID

Valid reader ID's are between 0 and 65535


Download

The unloading of data from the Timewand1 or Durawand readers.


Initialize

Setting-up the Timewand1 or Durawand readers so that they can scan bar codes and later have the data removed.  This has to happen before downloading data from the readers.


vProgFileName

vProgFileName is the file name for the configuration program that is downloaded into the Videx Timewand1 or Durawand readers.  These files configure the readers to read specific symbology among other things.  The file names end with "TWP" or "DWP" extensions.  For more information, see your Videx manual.

Default program

The control includes a default program that configures the reader for code 3 of 9 symbology with dual direction scan capabilities.  The control will use the default program if vProgFileName is left blank or if the file name specified is not found or invalid.

When a valid file name is specified, the name of the file will appear in the status text above the percentage bar when the control is loading the program into the reader.  If no file name is specified, the status text will display "Load Program".

If the file name is invalid or non-existant the control will return an "Invalid file name" ComError event.


Program file not found or invalid

You entered a Videx config program file name that either was not found or was invalid.